<?php
	namespace Home\Model;
	use Think\Model;

	class HomeUserModel extends Model
	{
		//自动验证
		protected $_validate = array(
			array('verfiycode','require','请填写验证码'),
	        array('verfiycode','check_verify','验证码不正确',0,'function'),
			array('username','require','请填写用户名！'),
	        array('username','6,50','用户名在6个字到50个字之间！',1,'length'),
	        array('username','','帐号名称已经存在！',0,'unique',1),
	        array('pwd1','require','请填写密码！'),
	        array('pwd1','6,50','密码在6个字到50个字之间！',2,'length'),
	        array('pwd2','require','请确认密码！'),
	        array('pwd2','password','两次输入的密码不一致！',0,'confirm'),
	        array('mail','require','请输入邮箱'),
	        array('mail','email','请输入正确的邮箱'),
	        array('mail','','邮箱已经被使用！',0,'unique',1),
			);
		//自动完成
		protected $_auto = array(
			array('add_time', 'getDate', Model:: MODEL_INSERT, 'callback'),
		);
		    // 获取当前日期时间
	    public function getDate()
	    {
	        return time();
	    }


	}